<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\BaseController;
use Illuminate\Http\Request;

/**
 * @package App\Http\Controllers\Api
 * @see DynamicController
 */
class DynamicController extends BaseController
{

    /**
     * del
     * @uri /dynamic/del
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @request {"id":"131F916D15E4A602"}
     * @response {"success":true,"statusCode":200,"result":true,"message":"OK"}
     */
    public function del(Request $request)
    {
        $params = $request->all();

        // @todo api data from mock.
        $mock = json_decode(
            mb_convert_encoding(
                '{"success":true,"statusCode":200,"result":true,"message":"OK"}'
                , 'UTF-8', 'UTF-8,GBK,GB2312,BIG5' )
            , true
        );
        $data = $mock['result'];

        return $this->apiReturn($data);
    }

    /**
     * getDetail
     * @uri /dynamic/get-detail
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @request {"id":"524326420240EB1C"}
     * @response {"success":true,"statusCode":200,"result":{"id":"00KEFGC0YMS64RZ35SJRYJ2O","user_id":"00KA3D5KI0EM8X8S5MBNZO51","target_id":"00KEFGC1GPYEDTEXZCNNGCGB","target_type":1,"type":1,"is_deleted":0,"created_at":1598692662,"user":{"id":"00KA3D5KI0EM8X8S5MBNZO51","nickname":"\u5343\u5343","avatar":"bd3833c6d047c3e093bfac85395d305f.png"},"article":{"\u3010\u6ce8\u610f\u3011":"\u6b64\u8282\u70b9\u5728\u3010\u6587\u7ae0\u52a8\u6001\u3011\u4e2d\u624d\u6709\u503c\uff0c\u5426\u5219\u4e3a\u7a7a\u5bf9\u8c61","id":"00KEFGC1GPYEDTEXZCNNGCGB","cover_url":"f5198d64e3cb83392f1e18c7d1070c25.jpg","title":"\u7ea2\u7816\u7eff\u74e6\u5916\u9ad8\u697c\u6797\u7acb\uff0c\u662f\u8c01\u5e26\u6211\u7a7f\u8d8a\u65f6\u7a7a\uff1f","description":"\u6e05\u6668\uff0c\u6668\u5149\u71b9\u5fae\uff0c\u53e4\u8001\u7684\u57ce\u95e8\u5728\u8584\u96fe\u4e2d\u5f71\u5f71\u7ef0\u7ef0\uff0c\u800c\u5929\u5b89\u95e8\u5e7f\u573a\u4e0a\uff0c\u65e9\u5df2\u805a\u96c6\u4e86\u4eba\u7fa4\uff0c\u9759\u9759\u5730\u7b49\u5f85\u7740\u4e00\u62b9\u9c9c\u8273\u7684\u7ea2\u3002\u8fd9\u91cc\u662f","is_deleted":0,"is_shield":0,"created_at":1598692662,"content":"\u8fd9\u662f\u6587\u7ae0\u5185\u5bb9"},"note":{"\u3010\u6ce8\u610f\u3011":"\u6b64\u8282\u70b9\u5728\u3010\u7b14\u8bb0\u52a8\u6001\u3011\u4e2d\u624d\u6709\u503c\uff0c\u5426\u5219\u4e3a\u7a7a\u5bf9\u8c61","id":"00KFDD0DPC1LFYZUBPWFUFGD","user_id":"00K6R8NNVL4GVOGPIGQSPJN3","article_id":"00KCFV679OEOYZLPAUQCKZJX","is_choice":0,"is_deleted":0,"is_public":1,"is_shield":0,"created_at":1600742930,"content":"\u4e0d\u8fc7\u8fd9\u91cc\u9762\u4e0d\u5305\u62ec\u7cd6\u5206\u9ad8\u7684\u6c34\u679c\uff0c\u6bd4\u5982\u897f\u74dc\uff0c\u5403\u591a\u4e86\u4e00\u6837\u662f\u4f1a\u957f\u80d6\u7684","selected":"\u6c34\u679c\u4e2d\u6709\u4e00\u4e2a\u6c34\u5b57\uff0c\u987e\u540d\u601d\u4e49\uff0c\u91cc\u9762\u6240\u542b\u6709\u7684\u6c34\u5206\u5f88\u591a\uff0c\u5f88\u591a\u90fd\u8fbe\u5230\u4e8690%\u4ee5\u4e0a\u3002\u9664\u4e86\u725b\u6cb9\u679c\u3001\u69b4\u83b2\u7b49\u4e2a\u522b\u6c34\u679c\u4ee5\u5916\uff0c\u5927\u90e8\u5206\u6c34\u679c\u91cc\u6240\u542b\u7684\u8102\u80aa\u51e0\u4e4e\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\uff0c\u800c\u8102\u80aa\u662f\u4f9b\u7ed9\u80fd\u91cf\u7684\u4e3b\u8981\u7269\u8d28\u4e4b\u4e00\u3002\u56e0\u6b64\u589e\u52a0\u6c34\u679c\u8fd9\u79cd\u4f4e\u80fd\u91cf\u5bc6\u5ea6\u7684\u98df\u7269\uff0c\u53d6\u4ee3\u5176\u4ed6\u9ad8\u70ed\u91cf\u7684\u52a0\u5de5\u7c7b\u98df\u7269\uff0c\u53ef\u4ee5\u663e\u8457\u51cf\u5c11\u70ed\u91cf\u6444\u5165\uff0c\u6709\u6548\u5b9e\u73b0\u80fd\u91cf\u8d1f\u5e73\u8861\uff0c\u51cf\u5c11\u8102\u80aa\u7ec4\u7ec7\u751f\u6210\uff0c\u4ece\u800c\u6709\u5229\u4e8e\u63a7\u5236\u4f53\u91cd\u3002","article":{"id":"00KCFV679OEOYZLPAUQCKZJX","cover_url":"a8c95f0208256a1cdd5f3ede1256e572.jpg","title":"\u897f\u74dc\u3001\u8354\u679d\u3001\u69b4\u83b2\u2026\u2026\u5230\u5e95\u662f\u51cf\u80a5\u4f73\u54c1\u8fd8\u662f\u589e\u80a5\u5229\u5668\uff1f","description":"\u6c34\u679c\u8425\u517b\u5bc6\u5ea6\u9ad8\uff0c\u70ed\u91cf\u76f8\u5bf9\u8f83\u4f4e\uff0c\u4e14\u5bcc\u542b\u81b3\u98df\u7ea4\u7ef4\u3002\u6709\u7814\u7a76\u53d1\u73b0\u591a\u5403\u6c34\u679c\u4e0e\u4f53\u91cd\u964d\u4f4e\u76f8\u5173\uff0c\u539f\u56e0\u662f\u5403\u6c34\u679c\u6709\u5229\u4e8e\u51cf\u5c11\u603b\u80fd\u91cf","is_deleted":0,"is_shield":0,"created_at":1594364065},"count":{"collect":0,"like":0,"comment":0}}},"message":"OK"}
     */
    public function getDetail(Request $request)
    {
        $params = $request->all();

        // @todo api data from mock.
        $mock = json_decode(
            mb_convert_encoding(
                '{"success":true,"statusCode":200,"result":{"id":"00KEFGC0YMS64RZ35SJRYJ2O","user_id":"00KA3D5KI0EM8X8S5MBNZO51","target_id":"00KEFGC1GPYEDTEXZCNNGCGB","target_type":1,"type":1,"is_deleted":0,"created_at":1598692662,"user":{"id":"00KA3D5KI0EM8X8S5MBNZO51","nickname":"\u5343\u5343","avatar":"bd3833c6d047c3e093bfac85395d305f.png"},"article":{"\u3010\u6ce8\u610f\u3011":"\u6b64\u8282\u70b9\u5728\u3010\u6587\u7ae0\u52a8\u6001\u3011\u4e2d\u624d\u6709\u503c\uff0c\u5426\u5219\u4e3a\u7a7a\u5bf9\u8c61","id":"00KEFGC1GPYEDTEXZCNNGCGB","cover_url":"f5198d64e3cb83392f1e18c7d1070c25.jpg","title":"\u7ea2\u7816\u7eff\u74e6\u5916\u9ad8\u697c\u6797\u7acb\uff0c\u662f\u8c01\u5e26\u6211\u7a7f\u8d8a\u65f6\u7a7a\uff1f","description":"\u6e05\u6668\uff0c\u6668\u5149\u71b9\u5fae\uff0c\u53e4\u8001\u7684\u57ce\u95e8\u5728\u8584\u96fe\u4e2d\u5f71\u5f71\u7ef0\u7ef0\uff0c\u800c\u5929\u5b89\u95e8\u5e7f\u573a\u4e0a\uff0c\u65e9\u5df2\u805a\u96c6\u4e86\u4eba\u7fa4\uff0c\u9759\u9759\u5730\u7b49\u5f85\u7740\u4e00\u62b9\u9c9c\u8273\u7684\u7ea2\u3002\u8fd9\u91cc\u662f","is_deleted":0,"is_shield":0,"created_at":1598692662,"content":"\u8fd9\u662f\u6587\u7ae0\u5185\u5bb9"},"note":{"\u3010\u6ce8\u610f\u3011":"\u6b64\u8282\u70b9\u5728\u3010\u7b14\u8bb0\u52a8\u6001\u3011\u4e2d\u624d\u6709\u503c\uff0c\u5426\u5219\u4e3a\u7a7a\u5bf9\u8c61","id":"00KFDD0DPC1LFYZUBPWFUFGD","user_id":"00K6R8NNVL4GVOGPIGQSPJN3","article_id":"00KCFV679OEOYZLPAUQCKZJX","is_choice":0,"is_deleted":0,"is_public":1,"is_shield":0,"created_at":1600742930,"content":"\u4e0d\u8fc7\u8fd9\u91cc\u9762\u4e0d\u5305\u62ec\u7cd6\u5206\u9ad8\u7684\u6c34\u679c\uff0c\u6bd4\u5982\u897f\u74dc\uff0c\u5403\u591a\u4e86\u4e00\u6837\u662f\u4f1a\u957f\u80d6\u7684","selected":"\u6c34\u679c\u4e2d\u6709\u4e00\u4e2a\u6c34\u5b57\uff0c\u987e\u540d\u601d\u4e49\uff0c\u91cc\u9762\u6240\u542b\u6709\u7684\u6c34\u5206\u5f88\u591a\uff0c\u5f88\u591a\u90fd\u8fbe\u5230\u4e8690%\u4ee5\u4e0a\u3002\u9664\u4e86\u725b\u6cb9\u679c\u3001\u69b4\u83b2\u7b49\u4e2a\u522b\u6c34\u679c\u4ee5\u5916\uff0c\u5927\u90e8\u5206\u6c34\u679c\u91cc\u6240\u542b\u7684\u8102\u80aa\u51e0\u4e4e\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\uff0c\u800c\u8102\u80aa\u662f\u4f9b\u7ed9\u80fd\u91cf\u7684\u4e3b\u8981\u7269\u8d28\u4e4b\u4e00\u3002\u56e0\u6b64\u589e\u52a0\u6c34\u679c\u8fd9\u79cd\u4f4e\u80fd\u91cf\u5bc6\u5ea6\u7684\u98df\u7269\uff0c\u53d6\u4ee3\u5176\u4ed6\u9ad8\u70ed\u91cf\u7684\u52a0\u5de5\u7c7b\u98df\u7269\uff0c\u53ef\u4ee5\u663e\u8457\u51cf\u5c11\u70ed\u91cf\u6444\u5165\uff0c\u6709\u6548\u5b9e\u73b0\u80fd\u91cf\u8d1f\u5e73\u8861\uff0c\u51cf\u5c11\u8102\u80aa\u7ec4\u7ec7\u751f\u6210\uff0c\u4ece\u800c\u6709\u5229\u4e8e\u63a7\u5236\u4f53\u91cd\u3002","article":{"id":"00KCFV679OEOYZLPAUQCKZJX","cover_url":"a8c95f0208256a1cdd5f3ede1256e572.jpg","title":"\u897f\u74dc\u3001\u8354\u679d\u3001\u69b4\u83b2\u2026\u2026\u5230\u5e95\u662f\u51cf\u80a5\u4f73\u54c1\u8fd8\u662f\u589e\u80a5\u5229\u5668\uff1f","description":"\u6c34\u679c\u8425\u517b\u5bc6\u5ea6\u9ad8\uff0c\u70ed\u91cf\u76f8\u5bf9\u8f83\u4f4e\uff0c\u4e14\u5bcc\u542b\u81b3\u98df\u7ea4\u7ef4\u3002\u6709\u7814\u7a76\u53d1\u73b0\u591a\u5403\u6c34\u679c\u4e0e\u4f53\u91cd\u964d\u4f4e\u76f8\u5173\uff0c\u539f\u56e0\u662f\u5403\u6c34\u679c\u6709\u5229\u4e8e\u51cf\u5c11\u603b\u80fd\u91cf","is_deleted":0,"is_shield":0,"created_at":1594364065},"count":{"collect":0,"like":0,"comment":0}}},"message":"OK"}'
                , 'UTF-8', 'UTF-8,GBK,GB2312,BIG5' )
            , true
        );
        $data = $mock['result'];

        return $this->apiReturn($data);
    }

}